﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VideoClassLibrary.BusinessLogicLayer;
using VideoClassLibrary.Model;
using System.Data;

public partial class NewsAndNoticeManagement_UpdateRecruit : AdminUserBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            ShowMessage();
        }
    }
    private void ShowMessage()
    {
        string Rid = Request.QueryString["RID"];
        RecruitMessageModule Recruit = new RecruitMessageModule();
        string sid=SchoolID.ToString();
        string sql = " and id="+Rid;
        DataSet ds = Recruit.GetRecruitMessageList(sid, sql);
        V_RecruitStudent rec = new V_RecruitStudent();
        DataRow dr = ds.Tables[0].Rows[0];
        txtRecruitTitle.Text = dr["RecruitTitle"].ToString();
        edRecruitContent.Text = dr["RecruitContent"].ToString();
        RadioButtonList1.SelectedIndex = Convert.ToInt32(dr["IsPulished"]);
        
        
    }
    //修改提交
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        RecruitMessageModule Recruit = new RecruitMessageModule();
        V_RecruitStudent rec = new V_RecruitStudent();
        rec.ID =Convert.ToInt32(Request.QueryString["RID"]);
        rec.SchoolId = SchoolID;
        rec.RecruitTitle = this.txtRecruitTitle.Text;
        rec.RecruitContent = edRecruitContent.Text.ToString();
        rec.IsPulished =Convert.ToInt32(RadioButtonList1.SelectedIndex);
        Recruit.UpdateRecruitMessage(rec);
        Response.Redirect("RecruitMessageList.aspx");
    }
}
